import request from "@/utils/request";

//添加接口
export function addApi(data) {
  return request({
    url: '/api/create',
    method: 'post',
    data: data
  })
}

//根据分组id获取接口信息
export function getApi(apiGroupId, pageIndex, pageSize) {
  return request({
    url: '/api/list',
    method: 'get',
    params: {
      apiGroupId,
      pageIndex,
      pageSize
    }
  })
}

//删除接口
export function deleteApi(id) {
  return request({
    url: `/api/delete/${id}`,
    method: 'delete',
  })
}

//更新接口
export function updateApi(data) {
  return request({
    url: '/api/update',
    method: 'put',
    data: data
  })
}

//根据接口id查询接口
export function getApiById(id) {
  return request({
    url: '/api/' + id,
    method: 'get'
  })
}
